import request from '../../../utils/request.js'

// 新增
export const roleAdd = (data) => {
    return request({
        url: '/role/add',
        method: 'POST',
        data,
    })
}

// 编辑
export const roleUpdate = (data) => {
    return request({
        url: '/role/update',
        method: 'POST',
        data,
    })
}

// 删除
export const roleDelete = (data) => {
    return request({
        url: '/role/delete',
        method: 'POST',
        data,
    })
}

// 列表
export const roleList = (params) => {
    return request({
        url: '/role/list',
        method: 'GET',
        params,
    })
}

// 所有角色列表
export const roleAllList = () => {
    return request({
        url: '/role/allList',
        method: 'GET',
    })
}

// 权限设置
export const rolePermission = (data) => {
    return request({
        url: '/role/update/permission',
        method: 'POST',
        data,
    })
}